//
//  upShiftNavView.m
//  基本框架
//
//  Created by runone02 on 2018/8/6.
//  Copyright © 2018年 liqiyun. All rights reserved.
//

#import "upShiftNavView.h"

@interface upShiftNavView()

@end
@implementation upShiftNavView


- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self setupUI];
    }
    return self;
}

- (void)setupUI {
    //虚拟导航栏，存放title，设置，客服，信息btn
    self.navImageView = [[UIImageView alloc]init];
    self.navImageView.userInteractionEnabled = YES;
    [self addSubview:self.navImageView];
    [self.navImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.bottom.mas_equalTo(self);
    }];
    
//    //title
    self.titleLable = [[UILabel alloc]init];
    [self.navImageView addSubview:self.titleLable];
    [self.titleLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.navImageView);
        make.centerX.mas_equalTo(self.navImageView);
    }];

    self.titleLable.backgroundColor = [UIColor clearColor];
    self.titleLable.text = @"我的";
    self.titleLable.textColor = [UIColor whiteColor];
    self.titleLable.textAlignment = NSTextAlignmentCenter;
    self.titleLable.font = TITLE_FONT(30);
    [self.titleLable sizeToFit];

//    //设置
    
    self.setBtn = [[UIButton alloc]init];
    [self.setBtn setImage:IMAGE(@"blueSetting") forState:UIControlStateNormal];
    [self.navImageView addSubview:self.setBtn];
    
    [self.setBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.navImageView);
        make.left.mas_equalTo(self.navImageView).with.offset(W_RATIO(30));
    }];
//
//    //消息
    self.newsBtn = [[UIButton alloc]init];
    [self.newsBtn setImage:IMAGE(@"blueMessage") forState:UIControlStateNormal];
    [self.navImageView addSubview:self.newsBtn];
    [self.newsBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.navImageView);
        make.right.mas_equalTo(self.navImageView).with.offset(-W_RATIO(30));
    }];
    
 //    //客服
    self.askBtn = [[UIButton alloc]init];
    [self.askBtn setImage:IMAGE(@"blueOnLine") forState:UIControlStateNormal];
    [self.navImageView addSubview:self.askBtn];
    
    [self.askBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.navImageView);
        make.right.mas_equalTo(self.newsBtn.mas_left).with.offset(-W_RATIO(30));
    }];
    
//
//    //小headImg
    self.smallImgView = [[UIImageView alloc]init];
    [self.navImageView addSubview:self.smallImgView];
    [self.smallImgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.navImageView);
        make.right.mas_equalTo(self.titleLable.mas_left).with.offset(-W_RATIO(20));
        make.width.mas_equalTo(W_RATIO(60));
        make.height.mas_equalTo(W_RATIO(60));
    }];
    
}

@end
